<?php
/*
Module:		Websearch
Version:	20071205a-DAT
File:		require.php
*/
//require_once('xmlize-php5.inc');

function search($url)
{//!rss
	global $PROXY;  
	if($PROXY['enabled']==true)
	{
		if($PROXY['authentication']==true)
		{
		//implement login! should be easy
		}
		$context = stream_context_create
			(
				array
				(
					'http'=>array
					(
						'proxy'=>'tcp://'.$PROXY['host'].':'.$PROXY['port'],
						'request_fulluri'=>true  ,
					)
				)
			);
	        $file =  file_get_contents($url,false,$context);
	}else
	{
	        $file =  file_get_contents($url,false);	
	}
        $xml =xmlize($file);
        $all = $xml["feed"]["#"]["entry"];
	$items=1;
	for($i = 0; $i < $items;$i++)
        {
            $first = $all[$i];
            $links = $first["#"]["link"];
            $url = $links[$linkID];
            $heading = $first["#"]["title"][0]["#"];
            cmd_send(prep_text($heading,$url["@"]["href"]));
        }
}//!rss
	
?>
